<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2021/11/22
 * Time: 13:31
 */
namespace phpfuntions\mp_net;
//主机操作类Network 函数　
class myphp_network_host
{

    /**
     * checkdnsrr 函数：查找主机的域名记录
     * @access public
     * @return
     */
    public static function checkdnsrr ($host, $type = null) {
        return checkdnsrr($host, $type );

    }

    /**
     * dns_check_record 函数：查找主机的DNS记录
     * @access public
     * @return
     */
    public static function dns_check_record ($host, $type) {
        return dns_check_record($host, $type );

    }

    /**
     * dns_get_mx 函数：获取主机的MX记录
     * @access public
     * @return
     */
    public static function dns_get_mx ($hostname, &$mxhosts, &$weight) {
        return dns_get_mx( $hostname, $mxhosts, $weight);

    }

    /**
     * dns_get_record 函数：获取主机的DNS记录
     * @access public
     * @return
     */
    public static function dns_get_record ($hostname, $type = DNS_ANY, array &$authns = null, array &$addtl = null, &$raw = false) {
        return dns_get_record( $hostname, $type , $authns , $addtl ,$raw);

    }

    /**
     * gethostbyaddr 函数：返回主机名称　
     * @access public
     * @return
     */
    public static function gethostbyaddr ($ip_address) {
        return gethostbyaddr( $ip_address);

    }

    /**
     * gethostbyname 函数：返回IP地址　
     * @access public
     * @return
     */
    public static function gethostbyname ($hostname) {
        return gethostbyname($hostname );

    }

    /**
     * gethostbynamel 函数：返回IP地址列表
     * @access public
     * @return
     */
    public static function gethostbynamel ($hostname) {
        return gethostbynamel($hostname );

    }

    /**
     * getmxrr 函数：根据给出的域名返回MX记录　
     * @access public
     * @return
     */
    public static function getmxrr ($hostname, array &$mxhosts, array &$weight = null) {
        return getmxrr( $hostname, $mxhosts,$weight );

    }

    /**
     * getprotobyname 函数：返回协议名对应的协议号
     * @access public
     * @return
     */
    public static function getprotobyname ($name) {
        return getprotobyname( $name);

    }

    /**
     * getprotobynumber 函数：返回协议号对应的协议名称　
     * @access public
     * @return
     */
    public static function getprotobynumber ($number) {
        return getprotobynumber( $number);

    }

    /**
     * getservbyname 函数：获取协议名称对应的端口号
     * @access public
     * @return
     */
    public static function getservbyname ($service, $protocol) {
        return getservbyname( $service, $protocol);

    }

    /**
     * getservbyport 函数：获取端口对应的协议名称
     * @access public
     * @return
     */
    public static function getservbyport ($port, $protocol) {
        return getservbyport( $port, $protocol);

    }
}